import { ApiProperty } from "@nestjs/swagger";
import { Transform } from "class-transformer";
import { ArrayMinSize, IsArray, IsInt, IsPositive, Min } from "class-validator";

export class MoveFileDto {
    @IsArray()
    @IsInt({ each: true })
    @IsPositive({ each: true })
    @ArrayMinSize(1)
    @ApiProperty({ description: "要移动的文件ID列表", example: [1, 2, 3], required: true, type: [Number] })
    ids: number[];

    @Transform(({ value }) => Number(value))
    @IsInt()
    @Min(0)
    @ApiProperty({ description: "文件的隶属目录ID，0表示根目录（未分类）", example: 1, required: true, type: Number })
    dirId: number;
}
